package com.ms.demo;

import com.ms.demo.factory1.ShapeFactory;
import com.ms.demo.factory2.ColorFactory;

/**
 * @description: 工厂创造器/生成器类
 * @author: ms
 * @create: 2022-10-21 17:00
 */
public class FactoryProducer {

    public static AbstractFactory getFactory(String choice){
        if(choice.equalsIgnoreCase("SHAPE")){
            return new ShapeFactory();
        } else if(choice.equalsIgnoreCase("COLOR")){
            return new ColorFactory();
        }
        return null;
    }
}